//
//  FourthViewCell.m
//  YiqiMobile
//
//  Created by henry on 13-4-20.
//  Copyright (c) 2013年 henry. All rights reserved.
//

#import "FourthViewCell.h"

#import "Config.h"
#import "Utility.h"
#import "QuartzCore/QuartzCore.h"

@implementation FourthViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle=UITableViewCellSelectionStyleNone;
        
        self.logo=[[UIImageView alloc] initWithFrame:CGRectMake(12, 12, 40, 40)];
        self.logo.layer.cornerRadius=20;
        self.logo.layer.masksToBounds=YES;
        [self  addSubview:self.logo];
        
        
        self.content=[Utility detailTextLabel:CGRectMake(62, 16, 225, 17) andFontSize:12.0f];
        self.content.textColor=UIColorFromRGB(0x4b4b4b);
        [self addSubview:self.content];
        
        self.detailTitle=[Utility detailTextLabel:CGRectMake(62, 35, 220, 12) andFontSize:8.0f];
        self.detailTitle.textColor=UIColorFromRGB(0x4b4b4b);
        [self addSubview:self.detailTitle];
        
        UIImageView *arrowImageView=[[UIImageView alloc] initWithFrame:CGRectMake(280, 25, 19, 19)];
        arrowImageView.image=[Utility imageNamed:@"homepageCellarrow.png"];
        [self addSubview:arrowImageView];
        
        
        self.rejectButton=[Utility customButton:self action:@selector(ButtonOfCellAction:) normalImage:@"qz_publish_normal.png" lightedImage:@"qz_publish_hover.png" frame:CGRectMake(205, 20, 50, 20) title:nil tag:555];
        [self addSubview:self.rejectButton];
        
        self.agreeButton=[Utility customButton:self action:@selector(ButtonOfCellAction:) normalImage:@"qz_goedit_normal.png" lightedImage:@"qz_goedit_hover.png" frame:CGRectMake(260, 20, 50, 20) title:nil tag:555+1];
        [self addSubview:self.agreeButton];
    }
    return self;
}

-(void) ButtonOfCellAction:(UIButton*) sender{
    if (self.delegate&&[_delegate respondsToSelector:@selector(buttonOfCellAction:andtag:)]) {
        [_delegate buttonOfCellAction:self.indexPath andtag:sender.tag-555] ;
    }
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
